<?
require_once("lib.php"); 
?>
<?
$mapgGUID = '';
if ($_GET['map']) {
	$mapGUID = $_GET['map'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- Para que IE8 y IE9 procesen en modo estándar -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Argmap - Instituto Geográfico Nacional</title>
<!--<link tyle='text/css' href='http://layout.jquery-dev.net/lib/css/layout-default-latest.css' rel='stylesheet'>-->
<link type='text/css' href='<?=ELGG_MAPS_WEBPATH?>/css/cupertino/jquery-ui-1.8.11.custom.css' rel='stylesheet'>
<link type='text/css' href='http://fonts.googleapis.com/css?family=Cabin+Sketch:bold' rel='stylesheet'>
<link href='http://fonts.googleapis.com/css?family=Ubuntu:light,lightitalic,regular,italic,500,500italic,bold,bolditalic' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"></script>
<script type='text/javascript'>
var ELGG_MAPS_MAPGUID = "<?=$mapGUID?>";
var ELGG_MAPS_WEBPATH = "<?=ELGG_MAPS_WEBPATH?>";
var ELGG_MAPS_URL = "<?=ELGG_MAPS_URL?>";
var resetLayout = null;

$(document).ready(function () {
	elggMap.init({mapGUID: ELGG_MAPS_MAPGUID});
});
</script>
</head>
<body style="height:100%;overflow:hidden;">


<div class="ui-layout-north" id="Header">
	 <a href="<?=ELGG_MAPS_WEBPATH?>" target="_self" class="logo"><img src="<?=ELGG_MAPS_WEBPATH?>graphics/images/logo.png"/></a>
	 <div class="user_menu">
    		<div id="emSessionInfo"></div>
			<ul>
				<li><a href="#">Solicitar Usuario</a></li>
				<li><a href="#">Solicitar Grupo</a></li>
				<li><a href="#">Opciones de Uso</a></li>
			</ul>	 
	 </div>
</div>

<div id="Main">
	<div id="Sidebar" >
		<div id="userTabs">
			<ul class="user_box">
				<li><a href="json.php?method=dialog.map.userowned" title="myMaps">Mis Mapas</a></li>
				<li><a href="#mapMetadata">Datos</a></li>
				<li><a href="json.php?method=dialog.map.getPublic" title="publicMaps">Mapas Públicos</a></li>
			</ul>
			<div id="mapMetadata"></div>
			<div id="publicMaps"></div>
			<div id="myMaps">
				<?
				if ( isloggedin() ) {
					$newMapButton = "<div style='text-align:right'><button id='emMapNewButton' class='ui-button'>Nuevo mapa</button></div>";
				} else {
					$newMapButton = '';
				}
				?>
				<?//=$newMapButton?>
			</div>
		</div>
		
		<!-- <div id="ui-layout-west-bottom"></div> -->
	</div>

	<div class="ui-layout-center" id="mapbox"><div id="mapcontainer"></div></div>
</div>
	<div id="coordinatesParserContainer" style="display:none">
	<h2>Ingrese un par de coordenadas por línea</h2>
	<a class="moreInfo" href="#">Más información</a>
		<textarea style='height:98px;width:100%' class='input-textarea coordinatesParser' id='coordinatesParser'></textarea>
		<button id="searchByCoordinatesButton">Buscar en el mapa</button>
	</div>
</body>
<script type="text/javascript" src="<?=ELGG_MAPS_WEBPATH?>/vendors/jquery/jquery-ui-1.8.11.custom.min.js"></script>
<script type="text/javascript" src="<?=ELGG_MAPS_WEBPATH?>/vendors/jquery/jquery.form.js"></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/lib/OpenLayers-2.9/OpenLayers.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/lib/OpenLayers-2.9/lib/OpenLayers/Lang/es.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/OpenLayers.Feature.Vector.ext.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/OpenLayers.Layer.Vector.emKML.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/helpers.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.constants.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.events.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.remote.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.session.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.mapstuff.js'></script>
<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.edit.js'></script>

<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.ui.js'></script>

<script src='<?=ELGG_MAPS_WEBPATH?>/js/ElggMap.coordinatesParser.js'></script>
</html>
